package main.java.com.uycode.designpatterns.singleton;

public class Elvis {

    public static final Elvis INSTANCE = new Elvis();

    private Elvis() {}

    public void leaveTheBuilding() {}

    //
    public static Elvis getInstance() {return INSTANCE;}


    // 为了防止反序列化的时候导致出现新的Elvis实例
    private Object readResolve() {
        return INSTANCE;
    }


}
